//
// Created by Scave on 2024/9/27.
//
#include <jni.h>
#include "JVisitor.hpp"
#include "LogUtil.h"
#include "Lexer.h"

extern "C" {

JNIEXPORT void JNICALL Java_com_tiecode_compiler_test_CompilerTest_visit(JNIEnv* env, jclass klass, jobject visitor) {
  JVisitor* jVisitor = new JVisitor(env, visitor);
  TestVisit(jVisitor);
}

JNIEXPORT void JNICALL
Java_com_tiecode_compiler_test_CompilerTest_testLex(JNIEnv* env, jclass clazz) {
  LOGI("%s", "testLex")
  const char* text = "<a>bbbb</a>";
  reflex::Input input(text);
  tiec::TiecodeLexer lexer(input);
  int token;
  while ((token = lexer.lex()) != 0) {
    LOGI("%d", token)
  }
}

}
